﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace POShipLineRef
{
	[Serializable]
	public partial class POShipLineRefModel : UIModel
	{
		#region Constructor
		public POShipLineRefModel() : base("POShipLineRef")
		{
			InitClass();
			this.SetResourceInfo("b0c5979b-8b3c-49d5-b6c2-5ad1d4b8c2aa");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private POShipLineRefModel(bool isInit) : base("POShipLineRef")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new POShipLineRefModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("2db4e4e5-6db5-4697-9ef7-76267830c9fd");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.U9Demo.DeliverUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.PM.PO.POShipLine", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.PM.PO.POShipLine", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldSubLineNo
		{
			get { return this.Fields["SubLineNo"]; }
		}
		public IUIField FieldPOLine_DocLineNo
		{
			get { return this.Fields["POLine_DocLineNo"]; }
		}
		public IUIField FieldPOLine_PurchaseOrder_DocNo
		{
			get { return this.Fields["POLine_PurchaseOrder_DocNo"]; }
		}
		public IUIField FieldPOLine_PurchaseOrder_Supplier_Code
		{
			get { return this.Fields["POLine_PurchaseOrder_Supplier_Code"]; }
		}
		public IUIField FieldPOLine_PurchaseOrder_Supplier_Name
		{
			get { return this.Fields["POLine_PurchaseOrder_Supplier_Name"]; }
		}
		public IUIField FieldReqQtyTU
		{
			get { return this.Fields["ReqQtyTU"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","0a0ac655-b311-4baf-b08c-bcb427ab08d8");
			UIModelRuntimeFactory.AddNewUIField(this,"SubLineNo", typeof(Int32), false,"","System.Int32", "SubLineNo", true,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","af5f2323-501a-4581-a46f-705cbadeeb82");
			UIModelRuntimeFactory.AddNewUIField(this,"POLine_DocLineNo", typeof(Int32), false,"","System.Int32", "POLine.DocLineNo", false,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","a5f4d54b-495c-434c-855a-737defd5dd88");
			UIModelRuntimeFactory.AddNewUIField(this,"POLine_PurchaseOrder_DocNo", typeof(String), false,"","System.String", "POLine.PurchaseOrder.DocNo", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c25a29e4-972d-46c3-a7e2-64b59fb5faa8");
			UIModelRuntimeFactory.AddNewUIField(this,"POLine_PurchaseOrder_Supplier_Code", typeof(String), true,"","System.String", "POLine.PurchaseOrder.Supplier.Code", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","204ba48d-2b2b-4ae9-bbf8-20030683aa83");
			UIModelRuntimeFactory.AddNewUIField(this,"POLine_PurchaseOrder_Supplier_Name", typeof(String), true,"","System.String", "POLine.PurchaseOrder.Supplier.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","54b06f5f-1858-48e9-ae78-bbc7a5fd1550");
			UIModelRuntimeFactory.AddNewUIField(this,"ReqQtyTU", typeof(Decimal), true,"","System.Decimal", "ReqQtyTU", true,true, false, "",false,(UIFieldType)1,"91031687-94bb-4988-a939-df7bf999ef4f","db808bde-a5a5-4c15-a12f-8ba47a0eec6d");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  Int32 SubLineNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldSubLineNo] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldSubLineNo);
			}
			set{
				this[this.uiviewcRef.FieldSubLineNo] = value;
			}
		}
		
		
		public  Int32 POLine_DocLineNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldPOLine_DocLineNo] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldPOLine_DocLineNo);
			}
			set{
				this[this.uiviewcRef.FieldPOLine_DocLineNo] = value;
			}
		}
		
		
		public  String POLine_PurchaseOrder_DocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldPOLine_PurchaseOrder_DocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldPOLine_PurchaseOrder_DocNo);
			}
			set{
				this[this.uiviewcRef.FieldPOLine_PurchaseOrder_DocNo] = value;
			}
		}
		
		
		public  String POLine_PurchaseOrder_Supplier_Code
		{
			get{
				//object value = this[this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Code] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Code);
			}
			set{
				this[this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Code] = value;
			}
		}
		
		
		public  String POLine_PurchaseOrder_Supplier_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Name);
			}
			set{
				this[this.uiviewcRef.FieldPOLine_PurchaseOrder_Supplier_Name] = value;
			}
		}
		
		
		public  Decimal? ReqQtyTU
		{
			get{
				//object value = this[this.uiviewcRef.FieldReqQtyTU] ;
				//return (Decimal?)value;
				return GetValue<Decimal?>(this.uiviewcRef.FieldReqQtyTU);
			}
			set{
				this[this.uiviewcRef.FieldReqQtyTU] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"POLine.PurchaseOrder.Org.ID=#Context.OrgID#",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}